package SwingController;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import JDBC.PeopleActivities;
import SwingModel.CmsInstructor;
import SwingModel.CmsUser;
import SwingView.CmsCPPeople;
import SwingView.CmsMainView;
import SwingView.CmsPageSelector.CmsPage;

public class ALPeople implements ActionListener{

	private CmsMainView mainView;
	private CmsUser user;
	private CmsCPPeople peoplePage;

	//---------------------------------------------------------
	//CONSTRUCTOR:
	//---------------------------------------------------------		
	public ALPeople(CmsMainView mainView, CmsUser user){
		this.mainView = mainView;
		this.user = user;
		this.peoplePage = mainView.getContentPanel().getPeoplePage();
	}

	//---------------------------------------------------------
	//PERFORMING ACTION:
	//---------------------------------------------------------		
	@Override
	public void actionPerformed(ActionEvent e){
		//Set Page View the People Button
		mainView.displayPeoplePage(PeopleActivities.getListOfPeople(CmsPresenter.user.getSelectedCourse().getCourseID()));
	}
}
